<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>css表格独有的属性</title>
    <style>
      table {
        width: 500px;
        border: 1px solid green;
        /* 控制表格列宽 auto fixed */
        table-layout: fixed;
        /* 控制单元格间距 */
        border-spacing: 0;
        /* 合并相邻的单元格的边框 */
        border-collapse: collapse;
        /* 隐藏没有内容的单元格 */
        empty-cells: hide;
        /* 设置表格标题的位置 */
        caption-side: top;
        text-align: center;
      }
      th,
      td {
        border: 1px solid red;
      }
    </style>
  </head>
  <body>
    <table>
      <caption>
        表格用户信息
      </caption>
      <thead>
        <tr>
          <th>序号</th>
          <th>姓名</th>
          <th>年龄</th>
          <th>性别</th>
          <th>政治面貌</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>1</td>
          <td>张三</td>
          <td>18</td>
          <td>男</td>
          <td></td>
        </tr>
        <tr>
          <td>1</td>
          <td>张三</td>
          <td>18</td>
          <td>男</td>
          <td>党员</td>
        </tr>
        <tr>
          <td>1</td>
          <td>张三</td>
          <td>18</td>
          <td>男</td>
          <td>党员</td>
        </tr>
        <tr>
          <td>1</td>
          <td>张三</td>
          <td>18</td>
          <td>男</td>
          <td>党员</td>
        </tr>
        <tr>
          <td>1</td>
          <td>张三</td>
          <td>18</td>
          <td>男</td>
          <td>党员</td>
        </tr>
      </tbody>
    </table>
  </body>
</html>
